package com.bruan.d7_duration_period;

import java.time.Duration;
import java.time.LocalDate;
import java.time.Period;

public class Test {
    public static void main(String[] args) {
        LocalDate start = LocalDate.of(2022,11,1);
        LocalDate end = LocalDate.of(2023,12,21);

        //创建period对象
        Period period = Period.between(start,end);

        //获取信息
        System.out.println(period.getYears());
        System.out.println(period.getMonths());
        System.out.println(period.getDays());



    }
}
